package com.ophiux.member.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ophiux.member.model.entity.Member;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface MemberMapper extends BaseMapper<Member>{

    /**
     * 暂时用于模拟
     * @param id
     * @return
     */
    @Update("update member set status=status-#{amount} where id=#{id} and status-#{amount} >= 0")
    int updateAmount(@Param("id") Integer id, @Param("amount") Integer amount);
}